from selenium.webdriver.common.by import By


class AdminMyTicketLocator:
    # My ticket菜单
    my_ticket_tab = (By.CSS_SELECTOR, '[path="/console/tickets/myTicket"]')

    ticket_id = (By.XPATH,'(//a[contains(@target,"_blank")])[1]')

    #ticket_comments = (By.CSS_SELECTOR,'[data-text="true"]')
    #ticket_comments = (By.XPATH,'//*[@id="root"]/section/section/main/div/main/div/div/div/div/div/div[3]/div/div[4]/div[2]/div/div[1]/div[2]/div/div[2]/div/div')
    ticket_comments = (By.XPATH,'//*[@id="root"]/section/main/div/div/div/div/div/div/div/div[2]/div/div[4]/div[2]/div/div[1]/div[2]/div/div[2]/div/div')

    ticket_send = (By.XPATH,'//*[@id="root"]/section/main/div/div/div/div/div/div/div/div[2]/div/div[4]/div[2]/div/div[2]/button')

    ticket_last_comment = (By.XPATH, '//*[@id="scrollableDiv"]/div/div/div[1]/div/div[2]/div/p')

    #详情页，solved按钮
    solve_button = (By.XPATH,'(//button[contains(@class,"antd4-btn-primary")])[1]')
    solve_button_confirm = (By.XPATH, '(//button[contains(@class,"antd4-btn-primary")])[3]')

    # 表格筛选框
    # ticket_status
    ticket_status_filter = (By.XPATH, '(//span[contains(@class,"antd4-table-filter-trigger")])[2]')
    # 工单状态的选择框
    pending_for_service = (By.XPATH, '(//label[contains(@class,"antd4-checkbox-wrapper")])[1]')
    solving = (By.XPATH, '(//label[contains(@class,"antd4-checkbox-wrapper")])[2]')
    solved = (By.XPATH, '(//label[contains(@class,"antd4-checkbox-wrapper")])[3]')
    closed = (By.XPATH, '(//label[contains(@class,"antd4-checkbox-wrapper")])[4]')
    reset = (By.CSS_SELECTOR, '[class="antd4-btn antd4-btn-link antd4-btn-sm"]')
    ok = (By.CSS_SELECTOR, '[class="antd4-btn antd4-btn-primary antd4-btn-sm"]')

    # my ticket页面搜索框
    search_box = (By.ID, 'keywords')
    # my ticket页面搜索按钮
    search_button = (By.XPATH, '//button[contains(@class,"antd4-input-search-button")]')

    search_ticket_status = (By.XPATH, '//*[@class="antd4-badge-status-text"]')

    # 左侧菜单，My Ticket旁边的pending标签
    my_ticket_menu_new = (By.XPATH, '//li[contains(@path,"/console/tickets/myTicket")]/span/div/span[2]')
    # 右上角的new
    my_ticket_new = (By.XPATH, '//a[contains(@href,"/console/tickets/myTicket")]/span')

    # 列表的红点
    red_dot = (By.XPATH, '(//span[contains(@class,"antd4-badge-not-a-wrapper")])[1]/span[1]')